<!DOCTYPE html>
<html lang="en">
<head>
    <title>测试数据生成器</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="/static/bootstrap/css/bootstrap.css">
</head>
<body>
<div class="container">
    <div class="row">
        <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
            <form class="row mt-3" action="/api/test/text" method="post">
                <div class="col-8">
                    <input required type="text" name="size" class="form-control" placeholder="文本长度">
                </div>
                <div class="col-4">
                    <button type="submit" class="btn btn-outline-primary btn-sm">
                        生成文本
                    </button>
                </div>
            </form>
            <form class="row mt-3" action="/api/test/emoji" method="post">
                <div class="col-8">
                    <input required type="text" name="size" class="form-control" placeholder="表情长度">
                </div>
                <div class="col-4">
                    <button type="submit" class="btn btn-outline-primary btn-sm">
                        生成表情
                    </button>
                </div>
            </form>
            <form class="row mt-3 mb-3" action="/api/test/file" method="post">
                <div class="col-4">
                    <input required type="text" name="filename" class="form-control" placeholder="文件名">
                </div>
                 <div class="col-4">
                    <input required type="text" name="size" class="form-control" placeholder="文件大小(Byte)">
                </div>
                <div class="col-4">
                    <button type="submit" class="btn btn-outline-primary btn-sm">
                        生成文件
                    </button>
                </div>
            </form>
        </div>
        <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
            <table class="table">
                <thead>
                <tr>
                    <th scope="col">ID</th>
                    <th scope="col">类型</th>
                    <th scope="col">大小</th>
                    <th scope="col">内容</th>
                </tr>
                </thead>
                <tbody>
                {% for row in rows %}
                <tr>
                    <th scope="row">{{ row.id }}</th>
                    <td>{{ row.type }}</td>
                    <td>{{ row.size }}</td>
                    <td>{% if row.type == 'text' %}
                        {{ row.data }}
                        {% elif row.type == 'emoji' %}
                        {{ row.data }}
                        {% else %}
                        <a target="_blank" href="/test/file/{{ row.id }}">{{ row.data }}</a>
                        {% endif %}
                    </td>
                </tr>
                {% endfor %}
                </tbody>
            </table>
        </div>
    </div>
</div>


</body>
</html>